import axios from "../../index.js";
// 值班计划
// 人员库
export const getPersonListApi = (data) => {
  return axios.request({
    url: "/duty/dutyStaff/listPage",
    method: "post",
    data: data
  });
};
export const getPersonListPage = (data) => {
  return axios.request({
    url: "/duty/dutyStaff/listPageForDutyStaff",
    method: "post",
    params: data
  });
};

// 计划列表
export const getPlanListApi = (data) => {
  return axios.request({
    url: "/duty/duty/listPage",
    method: "post",
    data: data
  });
};

// 值班计划保存
export const savePlanApi = (data) => {
  return axios.request({
    url: "/duty/duty/save",
    method: "post",
    data: data
  });
};

// 值班计划编辑
export const editPlanApi = (data) => {
  return axios.request({
    url: "/duty/duty/updById",
    method: "post",
    data: data
  });
};

// 值班计划提交
export const submitPlanApi = (data) => {
  return axios.request({
    url: "/duty/duty/submit",
    method: "post",
    data: data
  });
};

// 值班计划删除
export const delPlanApi = (id) => {
  return axios.request({
    url: `/duty/duty/deleteById/${id}`,
    method: "post"
  });
};

// 值班计划详情
export const getByIdApi = (data) => {
  return axios.request({
    url: "/duty/duty/getById",
    method: "get",
    data: data
  });
};

// 人员变更
export const changePersonApi = (data) => {
  return axios.request({
    url: "/duty/dutyPlan/updById",
    method: "post",
    data: data
  });
};

// 获取人员请假数据
export const getLeaveDateApi = (data) => {
  return axios.request({
    url: "/duty/dutyPlan/getById",
    method: "get",
    data: data
  });
};

// 提交人员请假/签到/签退
export const changePersonAttendanceStatusApi = (data) => {
  return axios.request({
    url: "/duty/dutyAttendance/updById",
    method: "post",
    data: data
  });
};

// 值班日志日报列表
export const getLogDailyApi = (data) => {
  return axios.request({
    url: "/duty/dutyReport/listPage",
    method: "post",
    data: data
  });
};

// 值班左侧表
export const getDutyLeftTablesApi = (data) => {
  return axios.request({
    url: "/duty/dutyAttendance/theDayAttendance",
    method: "get",
    data: data
  });
};

// 值班日报日志提交
export const submitLogOrDailyApi = (data) => {
  return axios.request({
    url: "/duty/dutyReport/addOrUpdate",
    method: "post",
    data: data
  });
};

// 获取值班日志/日报名称
export const getLogOrDailyNameApi = (data) => {
  return axios.request({
    url: "/duty/dutyReport/dailyOrJournal",
    method: "post",
    data: data
  });
};

// 获取值班日志/日报详情
export const getLogOrDailyDetailApi = (data) => {
  return axios.request({
    url: "/duty/dutyReport/getById",
    method: "get",
    data: data
  });
};

// 查看他人日志
export const getOtherLogApi = (data) => {
  return axios.request({
    url: "/duty/dutyReport/getReportByAttendance",
    method: "post",
    data: data
  });
};



// 日报修改/审批
export const updateBydailyApi = (data) => {
  return axios.request({
    url: "/duty/dutyReport/updById",
    method: "post",
    data: data
  });
};

// 交接班
export const handelShiftApi = (data) => {
  return axios.request({
    url: "/duty/dutyAttendance/dutyShift",
    method: "post",
    data: data
  });
};

// 通过响应命令单获取应急日报
export const getDaliyByResponseIdApi = (data) => {
  return axios.request({
    url: "/emergency/emergencyDaily/getBySourceInfoId",
    method: "get",
    data: data
  });
};

// 通过预警通知单获取应急日报
export const getDailyNotificationIdApi = (data) => {
  return axios.request({
    url: "/warning/warningDaily/getDailyNotificationId",
    method: "get",
    data: data
  });
};
// 获取交接班数据
export const getShiftTableApi = (data) => {
  return axios.request({
    url: "/duty/dutyAttendance/getDutyAttendanceNewList",
    method: "post",
    data: data
  });
};
// 交接/接班
export const dutyShift = (data) => {
  return axios.request({
    url: "/duty/dutyAttendance/dutyShift",
    method: "post",
    data: data
  });
};
// 根据登录人和日期查询日报详情
export const getDetail = (data) => {
  return axios.request({
    url: "/duty/dutyReport/getDetail",
    method: "get",
    data: data
  });
};
// 审批/驳回日报
export const approvalDaily = (data) => {
  return axios.request({
    url: "/duty/dutyReport/approvalDaily",
    method: "get",
    data: data
  });
};
// 左侧-签到
export const dutySignIn = (data) => {
  return axios.request({
    url: "/duty/dutyAttendance/dutySignIn",
    method: "get",
    data: data
  });
};
// 左侧-签退
export const dutySignOut = (data) => {
  return axios.request({
    url: "/duty/dutyAttendance/dutySignOut",
    method: "get",
    data: data
  });
};
// 左侧-值班打卡
export const getLeftDutyClock = (data) => {
  return axios.request({
    url: "/duty/dutyAttendance/getLeftDutyClock",
    method: "post",
    data: data
  });
};
// 左侧-交接班
export const getLeftDutyHandover = (data) => {
  return axios.request({
    url: "/duty/dutyAttendance/getLeftDutyHandover",
    method: "post",
    data: data
  });
};
// 左侧-值班日志/值班日报
export const getLeftDutyNewspaper = (data) => {
  return axios.request({
    url: "/duty/dutyAttendance/getLeftDutyNewspaper",
    method: "post",
    data: data
  });
};
// 左侧-值班计划
export const getLeftDutyPlan = (data) => {
  return axios.request({
    url: "/duty/dutyAttendance/getLeftDutyPlan",
    method: "post",
    data: data
  });
};
// 一键同步
export const oneClickSync = (data) => {
  return axios.request({
    url: "/duty/dutyReport/oneClickSync",
    method: "post",
    params: data
  });
};
// 查找人员列表
export const getLeaveDetail = (data) => {
  return axios.request({
    url: "/duty/dutyPlan/getLeaveDetail",
    method: "get",
    data
  });
};
// 请假
export const dutyLeave = (data) => {
  return axios.request({
    url: "/duty/dutyAttendance/dutyLeave",
    method: "post",
    data
  });
};
// 查询值班计划的导入数据
export const listPlanDown = (data) => {
  return axios.request({
    url: "/duty/duty/listPlanDown",
    method: "get",
    data
  });
};
// 查询导入值班计划的具体值班
export const listPlanDownDetail = (data) => {
  return axios.request({
    url: "/duty/duty/listPlanDownDetail",
    method: "get",
    data
  });
};
// 根据组织机构ID获取机构信息
export const getOrgInfoByOrgId = (data) => {
  return axios.request({
    url: "/system/organization/getOrgInfoByOrgId",
    method: "get",
    data
  });
};
// 查询班次
export const getDutyDownList = (data) => {
  return axios.request({
    url: "/system/system/tDutyShift/getDutyDownList",
    method: "post",
    data
  });
};
